		clear
		clear mata
		set maxvar 10000

		import dbase "C:\Users\maxha\Box\EDWIN_DEP_Well_Data\Washington_County_Project\Final Code\Compiling Near Table\WC_Wells_Build_NearTable.dbf"
		drop OBJECTID
		rename IN_FID well_id
		rename NEAR_FID bldg_id
		merge m:1 bldg_id using "C:\Users\maxha\Box\EDWIN_DEP_Well_Data\Washington_County_Project\Final Code\Compiling Near Table\WC_TaxRoll_GIS_BackMerge1_short.dta"
		drop _merge bldg_id
		drop if NEAR_RANK==.
		rename NEAR_DIST near_building_dist
		rename type near_building_type
		
		merge m:1 well_id using "C:\Users\maxha\Box\EDWIN_DEP_Well_Data\Washington_County_Project\Final Code\Circle and Doughnut Tables\merge_to_bldg_sqm.dta"
		keep if _merge==3
		
		/*THERE ARE 45,799 BUILDINGS IN OUR FINAL SAMPLE*/
		
		bysort near_building_type: sum FootPrint_Area_SqM, detail
		sum FootPrint_Area_SqM, detail
		
		sum FootPrint_Area_SqM if near_building_type=="out"
			scalar total_out=r(sum)
		sum FootPrint_Area_SqM if near_building_type=="main"
			scalar total_main=r(sum)
			
		collapse (sum) FootPrint_Area_SqM, by (near_building_type)